using System;

namespace TaskFramework
{
    public class TaskEvent
    {
        internal TaskEvent(TaskInfo info, Exception e)
        {
            Info = info;
            HasResult = false;
            Exception = e;
            TaskCompleted = false;
        }

        internal TaskEvent(TaskInfo info, object result)
        {
            Info = info;
            HasResult = true;
            Result = result;
            TaskCompleted = false;
        }

        internal TaskEvent(TaskInfo info)
        {
            Info = info;
            HasResult = false;
            TaskCompleted = true;
        }

        public TaskInfo Info { get; private set; }

        public bool HasResult { get; private set; }

        public object Result { get; private set; }

        public bool TaskCompleted { get; private set; }

        public Exception Exception { get; private set; }
    }
}